#define _CRT_SECURE_NO_WARNINGS 1
#pragma warning(disable:6031)
#include <stdio.h>
#include<math.h>

int main() {
    int n;
    scanf("%d", &n);
    int arr[20] = { 0 };

    int max = 0 ;
    double result;
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
        result = sqrt(arr[i]);
        if (result != (int)result)
        {
            if (max < arr[i])
                max = arr[i];
        }
    }
    printf("%ld\n", max);

    return 0;
}